package com.example.dessertstoressm.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Repository;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("account")
@Repository
public class Account implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 8751282105532159742L;

    @TableField(value="userid")
    private String username;
    private String email;
    @TableField(value="firstname")
    private String firstName;
    @TableField(value="lastname")
    private String lastName;
    private String status;
    @TableField(value="addr1")
    private String address1;
    @TableField(value="addr2")
    private String address2;
    private String city;
    private String state;
    private String zip;
    private String country;
    private String phone;

    @TableField(exist = false)
    private SignOn signOn = new SignOn();
    @TableField(exist = false)
    private Profile profile = new Profile();
    @TableField(exist = false)
    private BannerData bannerData = new BannerData();

//    signOn
//    private String password;

//    profile
//    private String languagePreference;
//    private String favouriteCategoryId;
//    private boolean listOption;
//    private boolean bannerOption;

//    bannerData
//    private String favouriteCategoryId;
//    private String bannerName;

    public void setUsername(String username) {
        this.username = username;
        this.signOn.setUsername(username);
        this.profile.setUsername(username);
    }
}
